﻿@* 职位管理 左侧导航栏 *@

<div class="mleft">
	<div id="postMngLeft" class="left_jobs">

		@* <div class="li link_gray6 J_hoverbut t2 select"> *@

		<div class="li link_gray6 J_hoverbut t2">
			<a href="/company/joblist">管理职位</a>
		</div>
		<div class="li link_gray6 J_hoverbut t1 ">
			<a href="/company/jobadd">发布职位</a>
		</div>
		<div class="li link_gray6 J_hoverbut t3 ">
			<a href="javascript:void(0)">手机招聘</a>
		</div>
		<div class="li link_gray6 J_hoverbut t4 ">
			<a href="javascript:void(0)">招聘效果统计</a>
		</div>
	</div>
</div>
<script>
	$(function () {
		(function (window) {

			function getHrefConfig() {
				return {
					
					0: [ //管理职位
						'/company/joblist'
					],
					1: [ //发布职位
						"/company/jobadd",
					],
					2: [ //手机招聘

					],
					3: [ //招聘效果统计
					]


				}
			}

			//获取url的pathname
			var pathname = location.pathname;
			var pathnameArr = yHelper.regex.getRegexArr(pathname, /((\/[a-z][_a-z0-9]*)+)/ig);
			if (pathnameArr.length <= 0) {
				yHelper.response.redirect("/");
				return;
			}
			pathname = pathnameArr[0];
			var hrefConfig = getHrefConfig();
			var configindex = -1;
			for (var key in hrefConfig) {
				var arr = hrefConfig[key];
				for (var m in arr) {
					if (arr[m] == pathname) {
						configindex = key;
						break;
					}
				}
				if (!!configindex && configindex >= 0) {
					break;
				}
			}
			if (!configindex || configindex < 0) {
				console.error("请在职位管理的左侧导航分部视图中配置：" + pathname);
				return;
			}
			//激活样式
			var $theLi = $("#postMngLeft").children(".li").eq(configindex);
			$theLi.addClass("select");
			var href = $theLi.children("a").attr("href");
			if (pathname == href) {
				$theLi.children("a").attr("href", 'javascript:void(0)');
			}
		})(window)
	})
</script>